package base.thio;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;


public class ChannelCopy {
	private static final int BSIZE=1024;
	
	public static void main(String[] args) throws Exception{
		String inputPath="";
		String outputPath="";
		FileChannel in=new FileInputStream(inputPath).getChannel();
		FileChannel out=new FileOutputStream(outputPath).getChannel();
		ByteBuffer buffer=ByteBuffer.allocate(BSIZE);
		
		while(in.read(buffer)!=-1){
			buffer.flip();
			out.write(buffer);
			buffer.clear();
		}
		
	}
}
